#include <iostream>
#include <vector>

using std::cout;
using std::endl;
using std::vector;

template <typename Container>
void display(const Container &con)
{
    for(auto &elem : con)
    {
        cout << elem << "  ";
    }
    cout << endl;
}

void test()
{
    vector<int> number = {1, 3, 6, 5, 7, 5, 5, 5, 6, 8};
    display(number);

    auto it2 = number.end();
    for(auto it = number.begin(); it != it2; )
    {
        if(5 == *it)
        {
            number.erase(it);
        }
        else
        {
            ++it;
        }
    }
    display(number);
}
int main(int argc, char *argv[])
{
    test();
    return 0;
}

